export const useMapApi = (varsion = '1.4.15') => {
    return new Promise(res => {
       
        const url =
            'https://webapi.amap.com/maps?v=2.0&key=b9d9a939ad3b14503b196a08d434be2c&callback=onLoadMap&plugin=AMap.MouseTool,AMap.PolyEditor'
        const jsapi = document.createElement('script')
        jsapi.charset = 'utf-8'
        jsapi.src = url
        document.head.appendChild(jsapi)
        
        window.onLoadMap = function (params) {
            res()
        }
    })
}